inherited fmRegRequest: TfmRegRequest
  Left = 2
  Top = 1
  Width = 1022
  Height = 726
  Caption = #1056#1077#1075#1080#1089#1090#1088#1072#1094#1080#1103' '#1079#1072#1103#1074#1083#1077#1085#1080#1081
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 672
    Width = 1014
  end
  inherited Panel1: TPanel
    Width = 1014
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 844
    end
    inherited BitBtn2: TBitBtn
      Left = 932
    end
  end
  object ToolBar1: TToolBar [2]
    Left = 0
    Top = 45
    Width = 1014
    Height = 29
    ButtonWidth = 26
    Caption = 'ToolBar1'
    Images = DMInv.ilActive
    TabOrder = 2
    object tbAddR: TToolButton
      Left = 0
      Top = 2
      Hint = #1057#1086#1079#1076#1072#1090#1100' '#1079#1072#1103#1074#1083#1077#1085#1080#1077
      Caption = 'tbAddR'
      ImageIndex = 28
      ParentShowHint = False
      ShowHint = True
      OnClick = tbAddRClick
    end
    object tbEditR: TToolButton
      Left = 26
      Top = 2
      Hint = #1056#1077#1076#1072#1082#1090#1080#1088#1086#1074#1072#1090#1100' '#1079#1072#1103#1074#1083#1077#1085#1080#1077
      Caption = 'tbEditR'
      ImageIndex = 2
      ParentShowHint = False
      ShowHint = True
      OnClick = tbEditRClick
    end
    object tbDelR: TToolButton
      Left = 52
      Top = 2
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1079#1072#1103#1074#1083#1077#1085#1080#1077
      Caption = 'tbDelR'
      ImageIndex = 29
      ParentShowHint = False
      ShowHint = True
      OnClick = tbDelRClick
    end
    object ToolButton1: TToolButton
      Left = 78
      Top = 2
      Width = 8
      Caption = 'ToolButton1'
      ImageIndex = 30
      Style = tbsSeparator
    end
    object tbPrint: TToolButton
      Left = 86
      Top = 2
      Hint = #1055#1077#1095#1072#1090#1100' '#1086#1090#1095#1077#1090#1072' '#1087#1086' '#1079#1072#1103#1074#1083#1077#1085#1080#1103#1084
      Caption = 'tbPrint'
      ImageIndex = 11
      ParentShowHint = False
      ShowHint = True
      OnClick = tbPrintClick
    end
    object ToolButton2: TToolButton
      Left = 112
      Top = 2
      Width = 8
      Caption = 'ToolButton2'
      ImageIndex = 12
      Style = tbsSeparator
    end
    object cxLabel1: TcxLabel
      Left = 120
      Top = 4
      Caption = #1044#1072#1090#1072
    end
    object eDate: TcxButtonEdit
      Tag = 950
      Left = 150
      Top = 2
      ParentFont = False
      Properties.Buttons = <
        item
          Glyph.Data = {
            F6000000424DF600000000000000760000002800000010000000100000000100
            0400000000008000000000000000000000001000000000000000000000000000
            8000008000000080800080000000800080008080000080808000C0C0C0000000
            FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
            FFFFFFFFFFF0FFFFFFFFFFFFFF000FFFFFFFFFFFF00000FFFFFFFFFF0000000F
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
        end>
      Properties.MaxLength = 0
      Properties.ReadOnly = True
      Properties.OnButtonClick = eOsnPodrDatePropertiesButtonClick
      Properties.OnChange = eDatePropertiesChange
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -13
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.LookAndFeel.SkinName = ''
      Style.Shadow = False
      Style.IsFontAssigned = True
      StyleDisabled.LookAndFeel.SkinName = ''
      StyleFocused.LookAndFeel.SkinName = ''
      StyleHot.LookAndFeel.SkinName = ''
      TabOrder = 0
      Width = 217
    end
    object cxLabel2: TcxLabel
      Left = 367
      Top = 4
      Caption = #1058#1080#1087' '#1079#1072#1103#1074#1083#1077#1085#1080#1103
    end
    object dxLookupTreeView1: TdxLookupTreeView
      Left = 445
      Top = 2
      Width = 259
      Height = 24
      CanSelectParents = True
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentColor = False
      ParentFont = False
      TabOrder = 3
      TabStop = True
      TreeViewColor = clWindow
      TreeViewCursor = crDefault
      TreeViewFont.Charset = DEFAULT_CHARSET
      TreeViewFont.Color = clWindowText
      TreeViewFont.Height = -11
      TreeViewFont.Name = 'MS Sans Serif'
      TreeViewFont.Style = []
      TreeViewIndent = 19
      TreeViewReadOnly = False
      TreeViewShowButtons = True
      TreeViewShowHint = False
      TreeViewShowLines = True
      TreeViewShowRoot = True
      TreeViewSortType = stNone
      OnCloseUp = dxLookupTreeView1CloseUp
      DividedChar = '.'
      ListSource = dsSD
      KeyField = 'SDID'
      ListField = 'SDNAME'
      Options = [trDBCanDelete, trDBConfirmDelete, trCanDBNavigate, trSmartRecordCopy, trCheckHasChildren]
      ParentField = 'SDPARID'
      RootValue = Null
      TextStyle = tvtsShort
      Alignment = taLeftJustify
    end
    object ToolButton4: TToolButton
      Left = 704
      Top = 2
      Width = 8
      Caption = 'ToolButton4'
      ImageIndex = 13
      Style = tbsSeparator
    end
    object cxLabel3: TcxLabel
      Left = 712
      Top = 4
      Caption = #1060#1086#1088#1084#1072#1083#1080#1079#1072#1094#1080#1103' '#1079#1072#1103#1074#1083#1077#1085#1080#1081': '
    end
    object tbFormaliz: TToolButton
      Left = 852
      Top = 2
      Hint = #1060#1086#1088#1084#1072#1083#1080#1079#1086#1074#1072#1090#1100' '#1079#1072#1103#1074#1083#1077#1085#1080#1077
      Caption = 'tbFormaliz'
      ImageIndex = 24
      ParentShowHint = False
      ShowHint = True
      OnClick = tbFormalizClick
    end
    object ToolButton5: TToolButton
      Left = 878
      Top = 2
      Hint = #1087#1077#1095#1072#1090#1100' '#1079#1072#1088#1077#1075#1080#1089#1090#1088#1080#1088#1086#1074#1072#1085#1085#1086#1075#1086' '#1079#1072#1103#1074#1083#1077#1085#1080#1103
      Caption = 'ToolButton5'
      ImageIndex = 11
      ParentShowHint = False
      ShowHint = True
      OnClick = ToolButton5Click
    end
  end
  object dbgRR: TcxGrid [3]
    Left = 0
    Top = 74
    Width = 1014
    Height = 598
    Align = alClient
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 3
    LookAndFeel.Kind = lfStandard
    object tvRR: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.Insert.Visible = True
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = True
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.Position = fpTop
      OnCellDblClick = tvRRCellDblClick
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Kind = skCount
          FieldName = 'RRID'
          Column = tvRRRRID
        end>
      DataController.Summary.SummaryGroups = <>
      Filtering.ColumnFilteredItemsList = True
      OptionsBehavior.CellHints = True
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsData.CancelOnExit = False
      OptionsData.Editing = False
      OptionsView.CellEndEllipsis = True
      OptionsView.CellAutoHeight = True
      OptionsView.CellTextMaxLineCount = 1
      OptionsView.ColumnAutoWidth = True
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.GroupFooters = gfVisibleWhenExpanded
      OptionsView.HeaderEndEllipsis = True
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Header = DMInv.cxSiniyText
      object tvRRRRID: TcxGridDBColumn
        Caption = #8470' '#1087'/'#1087
        DataBinding.FieldName = 'RRID'
        Width = 54
      end
      object tvRRRRTIMEENTER: TcxGridDBColumn
        Caption = #1044#1072#1090#1072
        DataBinding.FieldName = 'RRTIMEENTER'
        Width = 77
      end
      object tvRRTYPE_REQUEST: TcxGridDBColumn
        Caption = #1058#1080#1087
        DataBinding.FieldName = 'TYPE_REQUEST'
        Width = 199
      end
      object tvRRFIO_POLUCH: TcxGridDBColumn
        Caption = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100' '#1091#1089#1083#1091#1075
        DataBinding.FieldName = 'FIO_POLUCH'
        Width = 181
      end
      object tvRRFIO_DL: TcxGridDBColumn
        Caption = #1055#1086#1076#1087#1080#1089#1072#1083
        DataBinding.FieldName = 'FIO_DL'
        Width = 301
      end
      object tvRRRRNOTE: TcxGridDBColumn
        Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081
        DataBinding.FieldName = 'RRNOTE'
        Width = 126
      end
      object tvRRAUTOR: TcxGridDBColumn
        Caption = #1040#1074#1090#1086#1088
        DataBinding.FieldName = 'AUTOR'
        Width = 133
      end
      object tvRRREDAKTOR: TcxGridDBColumn
        Caption = #1056#1077#1076#1072#1082#1090#1086#1088
        DataBinding.FieldName = 'REDAKTOR'
        Width = 108
      end
      object tvRRRRTIMEEDIT: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1088#1077#1076#1072#1082#1090#1080#1088'.'
        DataBinding.FieldName = 'RRTIMEEDIT'
        Width = 39
      end
      object tvRRIS_FORMALIZ: TcxGridDBColumn
        Caption = #1060#1086#1088#1084#1072#1083#1080#1079'.?'
        DataBinding.FieldName = 'IS_FORMALIZ'
        PropertiesClassName = 'TcxCheckBoxProperties'
        Properties.ValueChecked = 1
        Properties.ValueUnchecked = '0'
        Width = 32
      end
    end
    object cxGridLevel2: TcxGridLevel
      GridView = tvRR
    end
  end
  inherited dlgDS: TDataSource
    DataSet = qRR
  end
  object qRR: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT RR.*, SD.SDNAME as type_request, IIF(RR.RID IS NULL, 0, 1' +
        ') AS is_formaliz,'
      
        'p1.plastname || '#39' '#39' || SUBSTRING(p1.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p1.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS autor,'
      
        'p2.plastname || '#39' '#39' || SUBSTRING(p2.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p2.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS redaktor,'
      
        'p4.plastname || '#39' '#39' || SUBSTRING(p4.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p4.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS fio_poluch,'
      
        'p5.plastname || '#39' '#39' || SUBSTRING(p5.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p5.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS fio_dl'
      'FROM REGISTR_REQUEST RR'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = RR.RRTYPE'
      'LEFT OUTER JOIN USERS U1 ON U1.USNAME = RR.RRUSERENTER'
      'LEFT OUTER JOIN PEOPLE P1 ON P1.PID = U1.PID'
      'LEFT OUTER JOIN USERS U2 ON U2.USNAME = RR.RRUSEREDIT'
      'LEFT OUTER JOIN PEOPLE P2 ON P2.PID = U2.PID'
      'LEFT OUTER JOIN PEOPLE P4 ON P4.PID = RR.PID_POLUCH'
      'LEFT OUTER JOIN PEOPLE P5 ON P5.PID = RR.PID'
      'where rr.rrisdelete is null'
      'AND CAST(RR.RRTIMEENTER AS DATE) BETWEEN :data1 AND :data2')
    UpdateObject = quRR
    GeneratorField.Field = 'RRID'
    GeneratorField.Generator = 'GEN_REGISTR_REQUEST_ID'
    Left = 296
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'data1'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data2'
        ParamType = ptUnknown
      end>
    object qRRRRID: TIntegerField
      FieldName = 'RRID'
      Origin = '"REGISTR_REQUEST"."RRID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qRRRRTYPE: TIntegerField
      FieldName = 'RRTYPE'
      Origin = '"REGISTR_REQUEST"."RRTYPE"'
    end
    object qRRRID: TIntegerField
      FieldName = 'RID'
      Origin = '"REGISTR_REQUEST"."RID"'
    end
    object qRRRRUSERENTER: TIBStringField
      FieldName = 'RRUSERENTER'
      Origin = '"REGISTR_REQUEST"."RRUSERENTER"'
      Size = 40
    end
    object qRRRRTIMEENTER: TDateTimeField
      FieldName = 'RRTIMEENTER'
      Origin = '"REGISTR_REQUEST"."RRTIMEENTER"'
    end
    object qRRRRUSEREDIT: TIBStringField
      FieldName = 'RRUSEREDIT'
      Origin = '"REGISTR_REQUEST"."RRUSEREDIT"'
      Size = 40
    end
    object qRRRRTIMEEDIT: TDateTimeField
      FieldName = 'RRTIMEEDIT'
      Origin = '"REGISTR_REQUEST"."RRTIMEEDIT"'
    end
    object qRRPID_POLUCH: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"REGISTR_REQUEST"."PID_POLUCH"'
    end
    object qRRPID: TIntegerField
      FieldName = 'PID'
      Origin = '"REGISTR_REQUEST"."PID"'
    end
    object qRRRRNOTE: TIBStringField
      FieldName = 'RRNOTE'
      Origin = '"REGISTR_REQUEST"."RRNOTE"'
      Size = 255
    end
    object qRRRRISDELETE: TIntegerField
      FieldName = 'RRISDELETE'
      Origin = '"REGISTR_REQUEST"."RRISDELETE"'
    end
    object qRRAUTOR: TIBStringField
      FieldName = 'AUTOR'
      ProviderFlags = []
      Size = 769
    end
    object qRRREDAKTOR: TIBStringField
      FieldName = 'REDAKTOR'
      ProviderFlags = []
      Size = 769
    end
    object qRRFIO_POLUCH: TIBStringField
      FieldName = 'FIO_POLUCH'
      ProviderFlags = []
      Size = 769
    end
    object qRRFIO_DL: TIBStringField
      FieldName = 'FIO_DL'
      ProviderFlags = []
      Size = 769
    end
    object qRRTYPE_REQUEST: TIBStringField
      FieldName = 'TYPE_REQUEST'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qRRIS_FORMALIZ: TIntegerField
      FieldName = 'IS_FORMALIZ'
      ProviderFlags = []
    end
  end
  object quRR: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  RRID,'
      '  RRTYPE,'
      '  RID,'
      '  RRUSERENTER,'
      '  RRTIMEENTER,'
      '  RRUSEREDIT,'
      '  RRTIMEEDIT,'
      '  PID_POLUCH,'
      '  PID,'
      '  RRNOTE,'
      '  RRISDELETE'
      'from REGISTR_REQUEST '
      'where'
      '  RRID = :RRID')
    ModifySQL.Strings = (
      'update REGISTR_REQUEST'
      'set'
      '  PID = :PID,'
      '  PID_POLUCH = :PID_POLUCH,'
      '  RID = :RID,'
      '  RRID = :RRID,'
      '  RRISDELETE = :RRISDELETE,'
      '  RRNOTE = :RRNOTE,'
      '  RRTYPE = :RRTYPE'
      'where'
      '  RRID = :OLD_RRID')
    InsertSQL.Strings = (
      'insert into REGISTR_REQUEST'
      '  (PID, PID_POLUCH, RID, RRID, RRISDELETE, RRNOTE, RRTYPE)'
      'values'
      
        '  (:PID, :PID_POLUCH, :RID, :RRID, :RRISDELETE, :RRNOTE, :RRTYPE' +
        ')')
    DeleteSQL.Strings = (
      'update REGISTR_REQUEST'
      'set'
      '  RRISDELETE = 1'
      'where'
      '  RRID = :OLD_RRID'
      '')
    Left = 336
  end
  object qSD: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT FIRST 1 '#39' '#1042#1089#1077#39' AS sdname, -1 AS sdid, 26 AS sdparid, NULL' +
        ' AS sdisdelete'
      'FROM SYS_DIC sd3'
      'UNION'
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID  = 26'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      '')
    GeneratorField.Field = 'SDID'
    Left = 632
    Top = 120
    object qSDSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qSDSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qSDSDNAME: TIBStringField
      DisplayLabel = #1069#1083#1077#1084#1077#1085#1090
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qSDSDISDELETE: TIntegerField
      DisplayLabel = #1059#1076#1072#1083#1080#1090#1100'?'
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object dsSD: TDataSource
    DataSet = qSD
    Left = 595
    Top = 118
  end
  object qTemp: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT RR.*, SD.SDNAME as type_request, IIF(RR.RID IS NULL, 0, 1' +
        ') AS is_formaliz,'
      
        'p1.plastname || '#39' '#39' || SUBSTRING(p1.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p1.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS autor,'
      
        'p2.plastname || '#39' '#39' || SUBSTRING(p2.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p2.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS redaktor,'
      
        'p4.plastname || '#39' '#39' || SUBSTRING(p4.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p4.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS fio_poluch,'
      
        'p5.plastname || '#39' '#39' || SUBSTRING(p5.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p5.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS fio_dl'
      'FROM REGISTR_REQUEST RR'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = RR.RRTYPE'
      'LEFT OUTER JOIN USERS U1 ON U1.USNAME = RR.RRUSERENTER'
      'LEFT OUTER JOIN PEOPLE P1 ON P1.PID = U1.PID'
      'LEFT OUTER JOIN USERS U2 ON U2.USNAME = RR.RRUSEREDIT'
      'LEFT OUTER JOIN PEOPLE P2 ON P2.PID = U2.PID'
      'LEFT OUTER JOIN PEOPLE P4 ON P4.PID = RR.PID_POLUCH'
      'LEFT OUTER JOIN PEOPLE P5 ON P5.PID = RR.PID'
      'where rr.rrisdelete is null'
      'AND CAST(RR.RRTIMEENTER AS DATE) BETWEEN :data1 AND :data2')
    GeneratorField.Field = 'RRID'
    Left = 296
    Top = 96
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'data1'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data2'
        ParamType = ptUnknown
      end>
    object IntegerField1: TIntegerField
      FieldName = 'RRID'
      Origin = '"REGISTR_REQUEST"."RRID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IntegerField2: TIntegerField
      FieldName = 'RRTYPE'
      Origin = '"REGISTR_REQUEST"."RRTYPE"'
    end
    object IntegerField3: TIntegerField
      FieldName = 'RID'
      Origin = '"REGISTR_REQUEST"."RID"'
    end
    object IBStringField1: TIBStringField
      FieldName = 'RRUSERENTER'
      Origin = '"REGISTR_REQUEST"."RRUSERENTER"'
      Size = 40
    end
    object DateTimeField1: TDateTimeField
      FieldName = 'RRTIMEENTER'
      Origin = '"REGISTR_REQUEST"."RRTIMEENTER"'
    end
    object IBStringField2: TIBStringField
      FieldName = 'RRUSEREDIT'
      Origin = '"REGISTR_REQUEST"."RRUSEREDIT"'
      Size = 40
    end
    object DateTimeField2: TDateTimeField
      FieldName = 'RRTIMEEDIT'
      Origin = '"REGISTR_REQUEST"."RRTIMEEDIT"'
    end
    object IntegerField4: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"REGISTR_REQUEST"."PID_POLUCH"'
    end
    object IntegerField5: TIntegerField
      FieldName = 'PID'
      Origin = '"REGISTR_REQUEST"."PID"'
    end
    object IBStringField3: TIBStringField
      FieldName = 'RRNOTE'
      Origin = '"REGISTR_REQUEST"."RRNOTE"'
      Size = 255
    end
    object IntegerField6: TIntegerField
      FieldName = 'RRISDELETE'
      Origin = '"REGISTR_REQUEST"."RRISDELETE"'
    end
    object IBStringField4: TIBStringField
      FieldName = 'AUTOR'
      ProviderFlags = []
      Size = 769
    end
    object IBStringField5: TIBStringField
      FieldName = 'REDAKTOR'
      ProviderFlags = []
      Size = 769
    end
    object IBStringField6: TIBStringField
      FieldName = 'FIO_POLUCH'
      ProviderFlags = []
      Size = 769
    end
    object IBStringField7: TIBStringField
      FieldName = 'FIO_DL'
      ProviderFlags = []
      Size = 769
    end
    object IBStringField8: TIBStringField
      FieldName = 'TYPE_REQUEST'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object IntegerField7: TIntegerField
      FieldName = 'IS_FORMALIZ'
      ProviderFlags = []
    end
  end
  object qR: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT R.*,  RD.*, ST.STNAME AS usluga, SC.SCID, SC.SCISDELETE, ' +
        'SC.SCTIMEENTER,'
      
        'p1.plastname || '#39' '#39' || SUBSTRING(p1.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p1.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS autor_otkaza,'
      
        'p2.plastname || '#39' '#39' || SUBSTRING(p2.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p2.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS autor_sc,'
      
        'p3.plastname || '#39' '#39' || SUBSTRING(p3.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p3.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS udalil_sc,'
      
        'p4.plastname || '#39' '#39' || p4.pname|| '#39' '#39' || COALESCE(p4.ppatronymic' +
        ', '#39' '#39') AS fio_poluch,'
      
        'p5.plastname || '#39' '#39' || p5.pname|| '#39' '#39' || COALESCE(p5.ppatronymic' +
        ', '#39' '#39') AS fio_dl,'
      'TRIM(case'
      
        'WHEN (RD.RDISOTKAZ is NULL) AND (SC.SCID IS NULL) then '#39#1053#1077#1088#1072#1089#1089#1084#1086 +
        #1090#1088#1077#1085#1085#1072#1103#39
      'WHEN (rd.RDISOTKAZ = 1) then '#39#1054#1090#1082#1072#1079#39
      
        'WHEN (SC.SCID IS NOT NULL) AND (SC.SCISDELETE is NULL) then '#39#1057#1086#1079 +
        #1076#1072#1085#1086' '#1076#1086#1087'. '#1089#1086#1075#1083#1072#1096'. '#8470#39'||SC.SCID'
      
        'WHEN (SC.SCID IS NOT NULL) AND (SC.SCISDELETE is NOT NULL) then ' +
        #39#1059#1076#1072#1083#1077#1085#1086' '#1076#1086#1087'. '#1089#1086#1075#1083#1072#1096'. '#8470#39'||SC.SCID'
      'END) AS sost,'
      'TRIM( case'
      'WHEN (RD.RDISOTKAZ is NULL) AND (SC.SCID IS NULL) then NULL'
      
        'WHEN (rd.RDISOTKAZ = 1) then p1.plastname || '#39' '#39' || SUBSTRING(p1' +
        '.pname FROM 1 FOR 1) || '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymi' +
        'c FROM 1 FOR 1) || '#39'.'#39', '#39' '#39')'
      
        'WHEN (SC.SCID IS NOT NULL) AND (SC.SCISDELETE is NULL) then p2.p' +
        'lastname || '#39' '#39' || SUBSTRING(p2.pname FROM 1 FOR 1) || '#39'. '#39' || C' +
        'OALESCE(SUBSTRING(p2.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39')'
      
        'WHEN (SC.SCID IS NOT NULL) AND (SC.SCISDELETE is NOT NULL) then ' +
        'p3.plastname || '#39' '#39' || SUBSTRING(p3.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p3.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39')'
      'END) AS sost_autor'
      'FROM REQUEST R'
      'INNER JOIN REQUEST_DEF RD ON RD.RID = R.RID'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = RD.STID'
      
        'LEFT OUTER JOIN REQUEST_SCAN RS ON RS.RID = R.RID AND RS.RSTYPE ' +
        '= 1'
      
        'LEFT OUTER JOIN REQUEST_SCAN RS1 ON RS1.RID = R.RID AND RS1.RSTY' +
        'PE = 2'
      'LEFT OUTER JOIN SPEC_COND SC ON SC.SCID = RD.SCID'
      'LEFT OUTER JOIN USERS U1 ON U1.USNAME = RD.RDUSEREDIT'
      'LEFT OUTER JOIN PEOPLE P1 ON P1.PID = U1.PID'
      'LEFT OUTER JOIN USERS U2 ON U2.USNAME = SC.SCUSERENTER'
      'LEFT OUTER JOIN PEOPLE P2 ON P2.PID = U2.PID'
      'LEFT OUTER JOIN USERS U3 ON U3.USNAME = SC.SCUSEREDIT'
      'LEFT OUTER JOIN PEOPLE P3 ON P3.PID = U3.PID'
      'LEFT OUTER JOIN PEOPLE P4 ON P4.PID = R.PID_POLUCH'
      'LEFT OUTER JOIN PEOPLE P5 ON P5.PID = R.PID'
      'where r.rid = :RID')
    Left = 776
    Top = 128
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'RID'
        ParamType = ptUnknown
      end>
    object qRRID: TIntegerField
      FieldName = 'RID'
      Origin = '"REQUEST"."RID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qRPID_POLUCH: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"REQUEST"."PID_POLUCH"'
    end
    object qRPID: TIntegerField
      FieldName = 'PID'
      Origin = '"REQUEST"."PID"'
    end
    object qRRUSERENTER: TIBStringField
      FieldName = 'RUSERENTER'
      Origin = '"REQUEST"."RUSERENTER"'
      Size = 40
    end
    object qRRTIMEENTER: TDateTimeField
      FieldName = 'RTIMEENTER'
      Origin = '"REQUEST"."RTIMEENTER"'
    end
    object qRRUSEREDIT: TIBStringField
      FieldName = 'RUSEREDIT'
      Origin = '"REQUEST"."RUSEREDIT"'
      Size = 40
    end
    object qRRTIMEEDIT: TDateTimeField
      FieldName = 'RTIMEEDIT'
      Origin = '"REQUEST"."RTIMEEDIT"'
    end
    object qRRNOTE: TIBStringField
      FieldName = 'RNOTE'
      Origin = '"REQUEST"."RNOTE"'
      Size = 255
    end
    object qRRDATE: TDateField
      FieldName = 'RDATE'
      Origin = '"REQUEST"."RDATE"'
    end
    object qRRISDELETE: TIntegerField
      FieldName = 'RISDELETE'
      Origin = '"REQUEST"."RISDELETE"'
    end
    object qRRDID: TIntegerField
      FieldName = 'RDID'
      Origin = '"REQUEST_DEF"."RDID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qRRID1: TIntegerField
      FieldName = 'RID1'
      Origin = '"REQUEST_DEF"."RID"'
    end
    object qRSCID: TIntegerField
      FieldName = 'SCID'
      Origin = '"REQUEST_DEF"."SCID"'
    end
    object qRRDUSERENTER: TIBStringField
      FieldName = 'RDUSERENTER'
      Origin = '"REQUEST_DEF"."RDUSERENTER"'
      Size = 40
    end
    object qRRDTIMEENTER: TDateTimeField
      FieldName = 'RDTIMEENTER'
      Origin = '"REQUEST_DEF"."RDTIMEENTER"'
    end
    object qRRDUSEREDIT: TIBStringField
      FieldName = 'RDUSEREDIT'
      Origin = '"REQUEST_DEF"."RDUSEREDIT"'
      Size = 40
    end
    object qRRDTIMEEDIT: TDateTimeField
      FieldName = 'RDTIMEEDIT'
      Origin = '"REQUEST_DEF"."RDTIMEEDIT"'
    end
    object qRRDNOTE: TIBStringField
      FieldName = 'RDNOTE'
      Origin = '"REQUEST_DEF"."RDNOTE"'
      Size = 255
    end
    object qRRDBEGIN: TDateField
      FieldName = 'RDBEGIN'
      Origin = '"REQUEST_DEF"."RDBEGIN"'
    end
    object qRRDEND: TDateField
      FieldName = 'RDEND'
      Origin = '"REQUEST_DEF"."RDEND"'
    end
    object qRRDCOUNT: TIntegerField
      FieldName = 'RDCOUNT'
      Origin = '"REQUEST_DEF"."RDCOUNT"'
    end
    object qRRDISOTKAZ: TIntegerField
      FieldName = 'RDISOTKAZ'
      Origin = '"REQUEST_DEF"."RDISOTKAZ"'
    end
    object qRUSLUGA: TIBStringField
      FieldName = 'USLUGA'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qRSCID1: TIntegerField
      FieldName = 'SCID1'
      Origin = '"SPEC_COND"."SCID"'
    end
    object qRSCISDELETE: TIntegerField
      FieldName = 'SCISDELETE'
      Origin = '"SPEC_COND"."SCISDELETE"'
    end
    object qRSCTIMEENTER: TDateTimeField
      FieldName = 'SCTIMEENTER'
      Origin = '"SPEC_COND"."SCTIMEENTER"'
    end
    object qRAUTOR_OTKAZA: TIBStringField
      FieldName = 'AUTOR_OTKAZA'
      ProviderFlags = []
      Size = 769
    end
    object qRAUTOR_SC: TIBStringField
      FieldName = 'AUTOR_SC'
      ProviderFlags = []
      Size = 769
    end
    object qRUDALIL_SC: TIBStringField
      FieldName = 'UDALIL_SC'
      ProviderFlags = []
      Size = 769
    end
    object qRFIO_POLUCH: TIBStringField
      FieldName = 'FIO_POLUCH'
      ProviderFlags = []
      Size = 769
    end
    object qRFIO_DL: TIBStringField
      FieldName = 'FIO_DL'
      ProviderFlags = []
      Size = 769
    end
    object qRSOST: TIBStringField
      FieldName = 'SOST'
      ProviderFlags = []
      Size = 33
    end
    object qRSOST_AUTOR: TIBStringField
      FieldName = 'SOST_AUTOR'
      ProviderFlags = []
      Size = 769
    end
    object qRSTID: TIntegerField
      FieldName = 'STID'
      Origin = '"REQUEST_DEF"."STID"'
    end
  end
  object qRD: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT RD.*, STP.STNAME AS usluga'
      'FROM REQUEST_DEF RD'
      'INNER JOIN services_type stp ON stp.stid = rd.STID'
      'WHERE RD.RID = :RID')
    Left = 808
    Top = 128
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'RID'
        ParamType = ptUnknown
      end>
  end
  object frRequest: TfrxReport
    Version = '4.9.32'
    DotMatrixReport = False
    IniFile = '\Software\Fast Reports'
    PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
    PreviewOptions.Zoom = 1.000000000000000000
    PrintOptions.Printer = 'Default'
    PrintOptions.PrintOnSheet = 0
    ReportOptions.CreateDate = 40798.704853252300000000
    ReportOptions.LastChange = 41256.841100416670000000
    ScriptLanguage = 'PascalScript'
    StoreInDFM = False
    Left = 856
    Top = 128
  end
  object frDS_R: TfrxDBDataset
    UserName = 'R'
    CloseDataSource = False
    DataSet = qR
    BCDToCurrency = False
    Left = 776
    Top = 160
  end
  object frDS_RD: TfrxDBDataset
    UserName = 'RD'
    CloseDataSource = False
    DataSet = qRD
    BCDToCurrency = False
    Left = 808
    Top = 160
  end
  object frxPDFExport1: TfrxPDFExport
    UseFileCache = True
    ShowProgress = True
    OverwritePrompt = False
    PrintOptimized = False
    Outline = False
    Background = False
    HTMLTags = True
    Author = 'FastReport'
    Subject = 'FastReport PDF export'
    ProtectionFlags = [ePrint, eModify, eCopy, eAnnot]
    HideToolbar = False
    HideMenubar = False
    HideWindowUI = False
    FitWindow = False
    CenterWindow = False
    PrintScaling = False
    Left = 888
    Top = 128
  end
  object frxRichObject1: TfrxRichObject
    Left = 888
    Top = 160
  end
  object frxXLSExport1: TfrxXLSExport
    UseFileCache = True
    ShowProgress = True
    OverwritePrompt = False
    ExportEMF = True
    AsText = False
    Background = True
    FastExport = True
    PageBreaks = True
    EmptyLines = True
    SuppressPageHeadersFooters = False
    Left = 856
    Top = 160
  end
  object frxqRRPrint: TfrxDBDataset
    UserName = 'frxqRRPrint'
    CloseDataSource = False
    DataSet = qRRPrint
    BCDToCurrency = False
    Left = 776
    Top = 224
  end
  object qRRPrint: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT RR.*, SD.SDNAME as type_request, IIF(RR.RID IS NULL, 0, 1' +
        ') AS is_formaliz,'
      
        'p1.plastname || '#39' '#39' || SUBSTRING(p1.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p1.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS autor,'
      
        'p2.plastname || '#39' '#39' || SUBSTRING(p2.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p2.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS redaktor,'
      
        'p4.plastname || '#39' '#39' || SUBSTRING(p4.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p4.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS fio_poluch,'
      
        'p5.plastname || '#39' '#39' || SUBSTRING(p5.pname FROM 1 FOR 1) || '#39'. '#39' ' +
        '|| COALESCE(SUBSTRING(p5.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39') ' +
        'AS fio_dl'
      'FROM REGISTR_REQUEST RR'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = RR.RRTYPE'
      'LEFT OUTER JOIN USERS U1 ON U1.USNAME = RR.RRUSERENTER'
      'LEFT OUTER JOIN PEOPLE P1 ON P1.PID = U1.PID'
      'LEFT OUTER JOIN USERS U2 ON U2.USNAME = RR.RRUSEREDIT'
      'LEFT OUTER JOIN PEOPLE P2 ON P2.PID = U2.PID'
      'LEFT OUTER JOIN PEOPLE P4 ON P4.PID = RR.PID_POLUCH'
      'LEFT OUTER JOIN PEOPLE P5 ON P5.PID = RR.PID'
      'where rr.rrisdelete is null'
      'AND CAST(RR.RRTIMEENTER AS DATE) = current_date'
      'order by rrid')
    GeneratorField.Field = 'RRID'
    Left = 776
    Top = 192
    object IntegerField8: TIntegerField
      FieldName = 'RRID'
      Origin = '"REGISTR_REQUEST"."RRID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IntegerField9: TIntegerField
      FieldName = 'RRTYPE'
      Origin = '"REGISTR_REQUEST"."RRTYPE"'
    end
    object IntegerField10: TIntegerField
      FieldName = 'RID'
      Origin = '"REGISTR_REQUEST"."RID"'
    end
    object IBStringField9: TIBStringField
      FieldName = 'RRUSERENTER'
      Origin = '"REGISTR_REQUEST"."RRUSERENTER"'
      Size = 40
    end
    object DateTimeField3: TDateTimeField
      FieldName = 'RRTIMEENTER'
      Origin = '"REGISTR_REQUEST"."RRTIMEENTER"'
    end
    object IBStringField10: TIBStringField
      FieldName = 'RRUSEREDIT'
      Origin = '"REGISTR_REQUEST"."RRUSEREDIT"'
      Size = 40
    end
    object DateTimeField4: TDateTimeField
      FieldName = 'RRTIMEEDIT'
      Origin = '"REGISTR_REQUEST"."RRTIMEEDIT"'
    end
    object IntegerField11: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"REGISTR_REQUEST"."PID_POLUCH"'
    end
    object IntegerField12: TIntegerField
      FieldName = 'PID'
      Origin = '"REGISTR_REQUEST"."PID"'
    end
    object IBStringField11: TIBStringField
      FieldName = 'RRNOTE'
      Origin = '"REGISTR_REQUEST"."RRNOTE"'
      Size = 255
    end
    object IntegerField13: TIntegerField
      FieldName = 'RRISDELETE'
      Origin = '"REGISTR_REQUEST"."RRISDELETE"'
    end
    object IBStringField12: TIBStringField
      FieldName = 'AUTOR'
      ProviderFlags = []
      Size = 769
    end
    object IBStringField13: TIBStringField
      FieldName = 'REDAKTOR'
      ProviderFlags = []
      Size = 769
    end
    object IBStringField14: TIBStringField
      FieldName = 'FIO_POLUCH'
      ProviderFlags = []
      Size = 769
    end
    object IBStringField15: TIBStringField
      FieldName = 'FIO_DL'
      ProviderFlags = []
      Size = 769
    end
    object IBStringField16: TIBStringField
      FieldName = 'TYPE_REQUEST'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object IntegerField14: TIntegerField
      FieldName = 'IS_FORMALIZ'
      ProviderFlags = []
    end
  end
  object frxqRR: TfrxDBDataset
    UserName = 'frxqRR'
    CloseDataSource = False
    DataSet = qRR
    BCDToCurrency = False
    Left = 296
    Top = 32
  end
  object qRCGP: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT R.*,'
      
        'p4.plastname || '#39' '#39' || p4.pname|| '#39' '#39' || COALESCE(p4.ppatronymic' +
        ', '#39' '#39') AS fio_poluch,'
      
        'p5.plastname || '#39' '#39' || p5.pname|| '#39' '#39' || COALESCE(p5.ppatronymic' +
        ', '#39' '#39') AS fio_dl,'
      
        'p2.plastname || '#39' '#39' || p2.pname|| '#39' '#39' || COALESCE(p2.ppatronymic' +
        ', '#39' '#39') AS autor,'
      
        'p3.plastname || '#39' '#39' || p3.pname|| '#39' '#39' || COALESCE(p3.ppatronymic' +
        ', '#39' '#39') AS editor,'
      'TRIM(case'
      'WHEN (R.RSOST IS NULL) then '#39#1053#1077#1088#1072#1089#1089#1084#1086#1090#1088#1077#1085#1085#1086#39
      'WHEN (R.RSOST = 0) then '#39#1054#1090#1082#1072#1079#39
      'WHEN (R.RSOST = 1) then '#39#1043#1088#1072#1092#1080#1082' '#1080#1079#1084#1077#1085#1077#1085#39
      'END) AS sost,'
      'TRIM(case'
      
        'WHEN ((COALESCE(R.RREZOL,0) = 0) AND (R.RREZOLNOTE IS NOT NULL))' +
        ' then '#39#1054#1090#1088#1080#1094#1072#1090#1077#1083#1100#1085#1072#1103' '#1088#1077#1079#1086#1083#1102#1094#1080#1103#39
      
        'WHEN ((COALESCE(R.RREZOL,0) = 1) AND (R.RREZOLNOTE IS NOT NULL))' +
        ' then '#39#1055#1086#1083#1086#1078#1080#1090#1077#1083#1100#1085#1072#1103' '#1088#1077#1079#1086#1083#1102#1094#1080#1103#39
      'END) AS rezol'
      'FROM requestgpchange R'
      'LEFT OUTER JOIN USERS U2 ON U2.USNAME = R.RUSEREDIT'
      'LEFT OUTER JOIN PEOPLE P3 ON P3.PID = U2.PID'
      'LEFT OUTER JOIN USERS U3 ON U3.USNAME = R.RUSERENTER'
      'LEFT OUTER JOIN PEOPLE P2 ON P2.PID = U3.PID'
      'LEFT OUTER JOIN PEOPLE P4 ON P4.PID = R.PID_POLUCH'
      'LEFT OUTER JOIN PEOPLE P5 ON P5.PID = R.PID'
      'WHERE R.RISDELETE IS NULL'
      'and r.rid = :RID'
      ''
      ''
      '')
    Left = 776
    Top = 264
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'RID'
        ParamType = ptUnknown
      end>
    object IntegerField15: TIntegerField
      FieldName = 'RID'
      Origin = '"REQUESTGPCHANGE"."RID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IntegerField16: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"REQUESTGPCHANGE"."PID_POLUCH"'
    end
    object IntegerField17: TIntegerField
      FieldName = 'PID'
      Origin = '"REQUESTGPCHANGE"."PID"'
    end
    object IBStringField17: TIBStringField
      FieldName = 'RUSERENTER'
      Origin = '"REQUESTGPCHANGE"."RUSERENTER"'
      Size = 40
    end
    object DateTimeField5: TDateTimeField
      FieldName = 'RTIMEENTER'
      Origin = '"REQUESTGPCHANGE"."RTIMEENTER"'
    end
    object IBStringField18: TIBStringField
      FieldName = 'RUSEREDIT'
      Origin = '"REQUESTGPCHANGE"."RUSEREDIT"'
      Size = 40
    end
    object DateTimeField6: TDateTimeField
      FieldName = 'RTIMEEDIT'
      Origin = '"REQUESTGPCHANGE"."RTIMEEDIT"'
    end
    object IBStringField19: TIBStringField
      FieldName = 'RNOTE'
      Origin = '"REQUESTGPCHANGE"."RNOTE"'
      Size = 255
    end
    object DateField1: TDateField
      FieldName = 'RDATE'
      Origin = '"REQUESTGPCHANGE"."RDATE"'
    end
    object IntegerField18: TIntegerField
      FieldName = 'RISDELETE'
      Origin = '"REQUESTGPCHANGE"."RISDELETE"'
    end
    object qRRSUMMA: TIBBCDField
      FieldName = 'RSUMMA'
      Origin = '"REQUESTGPCHANGE"."RSUMMA"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qRRREZOL: TIntegerField
      FieldName = 'RREZOL'
      Origin = '"REQUESTGPCHANGE"."RREZOL"'
    end
    object qRRSOST: TIntegerField
      FieldName = 'RSOST'
      Origin = '"REQUESTGPCHANGE"."RSOST"'
    end
    object qRRREZOLNOTE: TIBStringField
      FieldName = 'RREZOLNOTE'
      Origin = '"REQUESTGPCHANGE"."RREZOLNOTE"'
      Size = 255
    end
    object IntegerField19: TIntegerField
      FieldName = 'SCID'
      Origin = '"REQUESTGPCHANGE"."SCID"'
    end
    object qRRDATEGP: TDateField
      FieldName = 'RDATEGP'
      Origin = '"REQUESTGPCHANGE"."RDATEGP"'
    end
    object IBStringField20: TIBStringField
      FieldName = 'FIO_POLUCH'
      ProviderFlags = []
      Size = 767
    end
    object IBStringField21: TIBStringField
      FieldName = 'FIO_DL'
      ProviderFlags = []
      Size = 767
    end
    object qRAUTOR: TIBStringField
      FieldName = 'AUTOR'
      ProviderFlags = []
      Size = 767
    end
    object qREDITOR: TIBStringField
      FieldName = 'EDITOR'
      ProviderFlags = []
      Size = 767
    end
    object IBStringField22: TIBStringField
      FieldName = 'SOST'
      ProviderFlags = []
      Size = 14
    end
    object qRREZOL: TIBStringField
      FieldName = 'REZOL'
      ProviderFlags = []
      Size = 23
    end
  end
  object qRF: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT *'
      'from RGPC_DEF where rid = :rid')
    Left = 816
    Top = 264
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'rid'
        ParamType = ptUnknown
      end>
    object qRFRGPCDDATE: TDateField
      FieldName = 'RGPCDDATE'
      Origin = '"RGPC_DEF"."RGPCDDATE"'
    end
    object qRFRGPCDSUMMA: TIBBCDField
      FieldName = 'RGPCDSUMMA'
      Origin = '"RGPC_DEF"."RGPCDSUMMA"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
  end
  object qROtkaz: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT R.*,  RD.*, ST.STNAME AS usluga, SC.SCID, SC.SCISDELETE, ' +
        'SC.SCTIMEENTER,'
      
        'SC.SCTARIFWITHDISCOUNT, SC.SCDATEBEGIN, SC.SCDATEEND, SC.SCDATER' +
        'ASTORJ, SC.SCNUM_N||'#39'/'#39'||SC.SCID AS dopsogl_num,'
      
        'p4.plastname || '#39' '#39' || p4.pname|| '#39' '#39' || COALESCE(p4.ppatronymic' +
        ', '#39' '#39') AS fio_poluch,'
      
        'p5.plastname || '#39' '#39' || p5.pname|| '#39' '#39' || COALESCE(p5.ppatronymic' +
        ', '#39' '#39') AS fio_dl,'
      'TRIM(case'
      'WHEN (SC.SCDATERASTORJ IS NULL) then '#39#1053#1077#1088#1072#1089#1089#1084#1086#1090#1088#1077#1085#1085#1072#1103#39
      'WHEN (SC.SCDATERASTORJ IS NOT NULL) then '#39#1056#1072#1089#1090#1086#1088#1075#1085#1091#1090#1086#39
      'END) AS sost,'
      'TRIM( case'
      'WHEN (SC.SCDATERASTORJ IS NULL) then NULL'
      
        'WHEN (SC.SCDATERASTORJ IS NOT NULL) then p2.plastname || '#39' '#39' || ' +
        'SUBSTRING(p2.pname FROM 1 FOR 1) || '#39'. '#39' || COALESCE(SUBSTRING(p' +
        '2.ppatronymic FROM 1 FOR 1) || '#39'.'#39', '#39' '#39')'
      'END) AS sost_autor'
      'FROM REQUEST_OTKAZ R'
      'INNER JOIN REQUEST_DEF_OTKAZ RD ON RD.RID = R.RID'
      'LEFT OUTER JOIN SPEC_COND SC ON SC.SCID = RD.SCID'
      'LEFT OUTER JOIN SERVICES S ON S.SCID = SC.SCID'
      'LEFT OUTER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      'LEFT OUTER JOIN USERS U3 ON U3.USNAME = SC.SCUSEREDIT'
      'LEFT OUTER JOIN PEOPLE P2 ON P2.PID = U3.PID'
      'LEFT OUTER JOIN PEOPLE P4 ON P4.PID = R.PID_POLUCH'
      'LEFT OUTER JOIN PEOPLE P5 ON P5.PID = R.PID'
      'WHERE R.RISDELETE IS NULL'
      'and r.rid = :RID')
    Left = 776
    Top = 304
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'RID'
        ParamType = ptUnknown
      end>
    object IntegerField20: TIntegerField
      FieldName = 'RID'
      Origin = '"REQUEST_OTKAZ"."RID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IntegerField21: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"REQUEST_OTKAZ"."PID_POLUCH"'
    end
    object IntegerField22: TIntegerField
      FieldName = 'PID'
      Origin = '"REQUEST_OTKAZ"."PID"'
    end
    object IBStringField23: TIBStringField
      FieldName = 'RUSERENTER'
      Origin = '"REQUEST_OTKAZ"."RUSERENTER"'
      Size = 40
    end
    object DateTimeField7: TDateTimeField
      FieldName = 'RTIMEENTER'
      Origin = '"REQUEST_OTKAZ"."RTIMEENTER"'
    end
    object IBStringField24: TIBStringField
      FieldName = 'RUSEREDIT'
      Origin = '"REQUEST_OTKAZ"."RUSEREDIT"'
      Size = 40
    end
    object DateTimeField8: TDateTimeField
      FieldName = 'RTIMEEDIT'
      Origin = '"REQUEST_OTKAZ"."RTIMEEDIT"'
    end
    object IBStringField25: TIBStringField
      FieldName = 'RNOTE'
      Origin = '"REQUEST_OTKAZ"."RNOTE"'
      Size = 255
    end
    object DateField2: TDateField
      FieldName = 'RDATE'
      Origin = '"REQUEST_OTKAZ"."RDATE"'
    end
    object IntegerField23: TIntegerField
      FieldName = 'RISDELETE'
      Origin = '"REQUEST_OTKAZ"."RISDELETE"'
    end
    object IntegerField24: TIntegerField
      FieldName = 'RDID'
      Origin = '"REQUEST_DEF_OTKAZ"."RDID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IntegerField25: TIntegerField
      FieldName = 'SCID'
      Origin = '"REQUEST_DEF_OTKAZ"."SCID"'
    end
    object IBStringField26: TIBStringField
      FieldName = 'RDUSERENTER'
      Origin = '"REQUEST_DEF_OTKAZ"."RDUSERENTER"'
      Size = 40
    end
    object DateTimeField9: TDateTimeField
      FieldName = 'RDTIMEENTER'
      Origin = '"REQUEST_DEF_OTKAZ"."RDTIMEENTER"'
    end
    object IBStringField27: TIBStringField
      FieldName = 'RDUSEREDIT'
      Origin = '"REQUEST_DEF_OTKAZ"."RDUSEREDIT"'
      Size = 40
    end
    object DateTimeField10: TDateTimeField
      FieldName = 'RDTIMEEDIT'
      Origin = '"REQUEST_DEF_OTKAZ"."RDTIMEEDIT"'
    end
    object IBStringField28: TIBStringField
      FieldName = 'RDNOTE'
      Origin = '"REQUEST_DEF_OTKAZ"."RDNOTE"'
      Size = 255
    end
    object IBStringField29: TIBStringField
      FieldName = 'USLUGA'
      Origin = '"SERVICES_TYPE"."STNAME"'
      Size = 255
    end
    object IntegerField26: TIntegerField
      FieldName = 'SCISDELETE'
      Origin = '"SPEC_COND"."SCISDELETE"'
    end
    object DateTimeField11: TDateTimeField
      FieldName = 'SCTIMEENTER'
      Origin = '"SPEC_COND"."SCTIMEENTER"'
    end
    object qRSCTARIFWITHDISCOUNT: TIBBCDField
      FieldName = 'SCTARIFWITHDISCOUNT'
      Origin = '"SPEC_COND"."SCTARIFWITHDISCOUNT"'
      Precision = 18
      Size = 2
    end
    object qRSCDATEBEGIN: TDateField
      FieldName = 'SCDATEBEGIN'
      Origin = '"SPEC_COND"."SCDATEBEGIN"'
    end
    object qRSCDATEEND: TDateField
      FieldName = 'SCDATEEND'
      Origin = '"SPEC_COND"."SCDATEEND"'
    end
    object qRSCDATERASTORJ: TDateField
      FieldName = 'SCDATERASTORJ'
      Origin = '"SPEC_COND"."SCDATERASTORJ"'
    end
    object IBStringField30: TIBStringField
      FieldName = 'FIO_POLUCH'
      ProviderFlags = []
      Size = 767
    end
    object IBStringField31: TIBStringField
      FieldName = 'FIO_DL'
      ProviderFlags = []
      Size = 767
    end
    object IBStringField32: TIBStringField
      FieldName = 'SOST'
      ProviderFlags = []
      Size = 15
    end
    object IBStringField33: TIBStringField
      FieldName = 'SOST_AUTOR'
      ProviderFlags = []
      Size = 769
    end
    object qRDOPSOGL_NUM: TIBStringField
      FieldName = 'DOPSOGL_NUM'
      ProviderFlags = []
      Size = 23
    end
    object qRRDDATE_PREDPOL: TDateField
      FieldName = 'RDDATE_PREDPOL'
      Origin = '"REQUEST_DEF_OTKAZ"."RDDATE_PREDPOL"'
    end
  end
  object qRDOtkaz: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT RD.*, STP.STNAME, SC.SCNUM_N||'#39'/'#39'||SC.SCID AS dopsogl_num' +
        ', SC.SCDATEEND,'
      '        SC.SCTARIFWITHDISCOUNT, SC.SCDATEBEGIN'
      'FROM REQUEST_DEF_OTKAZ RD'
      'INNER JOIN spec_cond sc ON SC.SCID = RD.SCID'
      'INNER JOIN services ser ON ser.scid = sc.scid'
      'INNER JOIN services_type stp ON stp.stid = ser.stid'
      'WHERE RD.RID = :RID')
    Left = 816
    Top = 304
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'RID'
        ParamType = ptUnknown
      end>
  end
  object qRetFood: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT RF.*, p.PLASTNAME||'#39' '#39'||SUBSTRING(p.PNAME FROM 1 FOR 1 )|' +
        '|'#39'. '#39'||'
      
        'COALESCE(SUBSTRING(p.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39') AS polu' +
        'ch_usl,'
      'p1.PLASTNAME||'#39' '#39'||SUBSTRING(p1.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      'COALESCE(SUBSTRING(p1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39') AS PP,'
      'p2.PLASTNAME||'#39' '#39'||SUBSTRING(p2.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      
        'COALESCE(SUBSTRING(p2.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39') AS PP_' +
        'ue,'
      'p3.PLASTNAME||'#39' '#39'||SUBSTRING(p3.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      
        'COALESCE(SUBSTRING(p3.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39') AS PP_' +
        'uedit,'
      'RF1.RFVYPLACHENO, rf1.RFNOTEVYPL'
      'FROM RET_FOOD RF'
      'INNER JOIN PEOPLE P ON P.PID = RF.PID_POLUCH'
      'INNER JOIN PEOPLE P1 ON P1.PID = RF.PID'
      'INNER JOIN RETURN_FOOD RF1 ON RF1.RFID = RF.RFID'
      'LEFT OUTER JOIN USERS ue ON ue.USNAME = RF1.RFUSERENTER'
      'LEFT OUTER JOIN PEOPLE P2 ON P2.PID = ue.PID'
      'INNER JOIN RETURN_FOOD RF2 ON RF2.RFID = RF.RFID'
      'LEFT OUTER JOIN USERS ued ON ued.USNAME = RF2.RFUSEREDIT'
      'LEFT OUTER JOIN PEOPLE P3 ON P3.PID = ued.PID'
      'where rf.rfid = :rid')
    Left = 776
    Top = 344
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'rid'
        ParamType = ptUnknown
      end>
    object qRFPID_POLUCH: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"RET_FOOD"."PID_POLUCH"'
    end
    object qRFRFID: TIntegerField
      FieldName = 'RFID'
      Origin = '"RET_FOOD"."RFID"'
      Required = True
    end
    object qRFRFDATE: TDateField
      FieldName = 'RFDATE'
      Origin = '"RET_FOOD"."RFDATE"'
    end
    object qRFPID: TIntegerField
      FieldName = 'PID'
      Origin = '"RET_FOOD"."PID"'
    end
    object qRFRFDATEBEGIN: TDateField
      FieldName = 'RFDATEBEGIN'
      Origin = '"RET_FOOD"."RFDATEBEGIN"'
    end
    object qRFRFDATEEND: TDateField
      FieldName = 'RFDATEEND'
      Origin = '"RET_FOOD"."RFDATEEND"'
    end
    object qRFKVYPLATE: TIBBCDField
      FieldName = 'KVYPLATE'
      Origin = '"RET_FOOD"."KVYPLATE"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qRFPOLUCH_USL: TIBStringField
      FieldName = 'POLUCH_USL'
      ProviderFlags = []
      Size = 769
    end
    object qRFPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 769
    end
    object qRFPP_UE: TIBStringField
      FieldName = 'PP_UE'
      ProviderFlags = []
      Size = 769
    end
    object qRFPP_UEDIT: TIBStringField
      FieldName = 'PP_UEDIT'
      ProviderFlags = []
      Size = 769
    end
    object qRFRFNOTE: TIBStringField
      FieldName = 'RFNOTE'
      Origin = '"RET_FOOD"."RFNOTE"'
      Size = 255
    end
    object qRFPRICHINA: TIBStringField
      FieldName = 'PRICHINA'
      Origin = '"RET_FOOD"."PRICHINA"'
      Size = 255
    end
    object qRFKOLWDAY: TIntegerField
      FieldName = 'KOLWDAY'
      Origin = '"RET_FOOD"."KOLWDAY"'
    end
    object qRFKOL: TIntegerField
      FieldName = 'KOL'
      Origin = '"RET_FOOD"."KOL"'
    end
    object qRFDEN_PITANIYA: TIBBCDField
      FieldName = 'DEN_PITANIYA'
      Origin = '"RET_FOOD"."DEN_PITANIYA"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qRFRFVYPLACHENO: TIBBCDField
      FieldName = 'RFVYPLACHENO'
      Origin = '"RETURN_FOOD"."RFVYPLACHENO"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qRFRFNOTEVYPL: TIBStringField
      FieldName = 'RFNOTEVYPL'
      Origin = '"RETURN_FOOD"."RFNOTEVYPL"'
      Size = 255
    end
  end
  object frxqRetFood: TfrxDBDataset
    UserName = 'frxqRetFood'
    CloseDataSource = False
    DataSet = qRetFood
    BCDToCurrency = False
    Left = 816
    Top = 344
  end
end
